package com.zhuge_new.Adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.makeramen.roundedimageview.RoundedImageView;
import com.zhuge_new.R;
import com.zhuge_new.bean.RedexanminBean;
import com.zhuge_new.share.BaseHttp;

import java.util.List;

import javax.microedition.khronos.opengles.GL;

/**
 * Created by lenovo on 2018-09-27.
 */

public class Redexamine1Adapter extends BaseQuickAdapter<RedexanminBean.ObjectBean,BaseViewHolder> {

    private Context context;
    public Redexamine1Adapter(Context context, RedexanminBean redexanminBean) {
        super(R.layout.item_reddetails, redexanminBean.getObject());
        this.context=context;
    }


    @Override
    protected void convert(BaseViewHolder helper, RedexanminBean.ObjectBean item) {
        helper.setText(R.id.reddetaile_type,item.getThreeNickName());
        helper.setText(R.id.reddetaile_time,item.getGetTime().substring(5,10));
        TextView reddetaile_state=helper.getView(R.id.reddetaile_state);
        reddetaile_state.setVisibility(View.GONE);
        helper.setText(R.id.reddetaile_money,"￥"+item.getMoney());
        RoundedImageView reddetaile_logo=helper.getView(R.id.reddetaile_logo);
        RequestOptions options=new RequestOptions()
                .centerCrop()
                .placeholder(R.mipmap.ic_launcher_round)
                .placeholder(R.mipmap.ic_launcher_round)
                .priority(Priority.HIGH);

        Glide.with(context).load(BaseHttp.baseImg1+item.getThreeHeadPhoto()).apply(options).into(reddetaile_logo);
    }
}
